Madlib - A Fun Intro to FORMs and Functions

Goals

• Modify a game that plays "madlib". Uses the text/CD-ROM Designing with JavaScript -- Creating Dynamic Web Pages by Nick Heinle,Songline Studios and O'Reilly, 1997. An excellent starting lab.

• Play with and modify an example using HTML <FORM>s and JavaScript FUNCTIONS.

Directions

  1. From Chapter 4 of the Henile CD-ROM, snag the source code from:
  2. Madlibs: America's favorite party game.

  3. Play the game.
  4. Write comments (documentation) // to explain what sections of this program accomplish
  5. For example: // these next three lines open a small window and display the message in that window

  6. Change the story wording.
  7. In the MakeLibs function, can you make it generate one of two possible stories?
  8. How about randomly generating one story from five possible stories?
  9.  

  10. Consider changing the stories to arithmetic word problems of the sort that young children solve:

 

Ken has 3 files.

He trashes 2 of them.

How many files does Ken have left?

 

This is early thinking towards a JavaScript project we call: addLib. In addition to the actors and objects, what else could you make random in these word problems? (say, 'the numbers')

 

Note: in addLib with random values it is possible to create a word problem which is "mathematically unreasonable."

Students who will use your addLib software are challenged to determine first if a problem makes sense.